#!/usr/bin/env python
# encoding: utf-8  
#
#@author: zhujianhua
#
import sys
import os

sys.path.append('./helper')
#from ConfigReader import ConfigReader
#import InfoMonConstants
from helper.ConfigReader import ConfigReader
from helper import InfoMonConstants
#from ConnectionHelper import ConnectionHelper
from helper import ConnectionHelper
sys.path.append('./task')
#from ExecuteScripts import ExecuteScripts
#from Collector import Collector
from task import ExecuteScripts
from task.Collector import Collector

#初始化常量
def init():
    InfoMonConstants.CONFPATH = './etc/mon.cfg'
    cfg = ConfigReader(InfoMonConstants.CONFPATH)
    InfoMonConstants.HOST = cfg.get('host')
    InfoMonConstants.PORT = cfg.get('port')
    InfoMonConstants.USER = cfg.get('user')
    InfoMonConstants.PASSWORD = cfg.get('password')
    InfoMonConstants.SID = cfg.get('sid')
    InfoMonConstants.ENDPOINT = cfg.get('endpoint')
    InfoMonConstants.FALCON_CLINENT = cfg.get('falcon_client')
    InfoMonConstants.LOG_FILE = cfg.get('log_file')
    InfoMonConstants.LOG_LEVEL = cfg.get('log_level')

def Main():
    init()

    #执行脚本
    #exeCute = ExecuteScripts()
    #exeCute.execute()
    #数据收集,测试
    c = Collector()
    c.collect()
    #c.run()

if __name__ == '__main__':
    Main()

